<template>
  <div class="can-container">
    <span class="title">已交易项目</span>
    <el-divider></el-divider>
    <div class="form">
      <el-form
        :inline="true"
        label-position="right"
        label-width="120px"
        :model="formInline"
        class="demo-form-inline"
      >
        <el-form-item label="项目编号">
          <el-input v-model="formInline.pName" placeholder="项目编号"></el-input>
        </el-form-item>
        <el-form-item label="项目名称">
          <el-input v-model="formInline.name" placeholder="项目名称"></el-input>
        </el-form-item>
        <el-form-item label="合格证编号">
          <el-input v-model="formInline.idCard" placeholder="合格证编号"></el-input>
        </el-form-item>
        <el-form-item label="项目级别">
          <el-select v-model="formInline.type" placeholder="--请选择--">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="所在乡镇">
          <el-select v-model="formInline.state" placeholder="--请选择--">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">查询</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class="table">
      <div class="table-box">
        <xTable
          :loading="loading"
          index
          :head="head"
          :tableData="tableData"
          :search="formInline"
          @on-changePage="(v)=>getData(v)"
        />
      </div>
    </div>
  </div>
</template>

<script>
import xTable from "@/views/xtable.vue";
import { getList } from "@/api/table";
import { setTimeout } from "timers";
export default {
  components: {
    xTable
  },
  data() {
    return {
      loading: false,
      head: {
        date: "业务编号",
        name: "项目名称",
        province: "项目级别",
        city: "合格证编号",
        zip: "可交易面积（亩）",
      },
      formInline: {
        user: "",
        a: "",
        b: "",
        c: "",
        idCard: "",
        state: "",
        type: ""
      },
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1518 弄",
          zip: 200333
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1517 弄",
          zip: 200333
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1519 弄",
          zip: 200333
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1516 弄",
          zip: 200333
        }
      ],
      currentPage: 1,
      dialogFormVisible: false,
      textarea:""
    };
  },
  methods: {
    onSubmit() {
      this.getData(this.formInline);
    },
    sqtcClick(item) {
      console.log(item);
      this.dialogFormVisible = true;
    },
    getData(data) {
      console.log(data);
      //this.loading = true
      /*getList().then(rs => {
        this.tableData = rs.data;
        this.loading = false;
      })*/
    }
  },
  mounted() {
    this.getData();
  }
};
</script>

<style lang="scss" scoped>
.form /deep/ .el-input__inner {
  width: 200px;
}
</style>

<style lang="scss" scoped>
.can-container {
  padding: 20px;
  .title {
    font-size: 24px;
    font-weight: 500;
    color: rgba(72, 73, 77, 1);
    line-height: 33px;
  }
}
.table,
.table-box {
  margin-top: 20px;
  .block {
    float: right;
    margin: 30px;
  }
}
.dig-box {
  font-size: 14px;
  color: rgba(99, 100, 102, 1);
  line-height: 28px;
  margin-right: 30px;
}
</style>
